-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Message system - Add context banner to solana staking #17267
base: develop
Are you sure you want to change the base?
Conversation
fdc9165
to
619ab12
Compare
🚀 Expo preview is ready!
|
f55efb7
to
882540e
Compare
3a45369
to
60e3b2d
Compare
60e3b2d
to
fdd1c0d
Compare
WalkthroughThe changes add support for Solana staking within the wallet module. In the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
fdd1c0d
to
519c040
Compare
packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx
Outdated
Show resolved
Hide resolved
packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx
Outdated
Show resolved
Hide resolved
d80d8c5
to
c9a2cc5
Compare
Assembling @marekrjpolak for some code nazi review 🙏 |
I didn't test anything but I believe this should do the same in a somehow cleaner manner. Don't trust, verify. 33686c6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
suite-common/message-system/config/config.v1.json (1)
1334-1334
: Standardized Category Field FormatThe
category
field for the action with ID"a3c3a3b7-efbe-4e39-9ffd-1836338e7811"
is now updated to use an array format (i.e.["banner"]
) instead of a simple string. This modification improves consistency across the configuration. Ensure that any downstream code expects and correctly interprets thecategory
value as an array.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx
(2 hunks)packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx
(2 hunks)suite-common/message-system/config/config.v1.json
(3 hunks)suite-common/message-system/src/messageSystemTypes.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- suite-common/message-system/src/messageSystemTypes.ts
- packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx
- packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: EAS Update
- GitHub Check: prepare_android_test_app
- GitHub Check: Setup and Cache Dependencies
- GitHub Check: build-web
- GitHub Check: Analyze with CodeQL (javascript)
🔇 Additional comments (2)
suite-common/message-system/config/config.v1.json (2)
4-4
: Sequence Number IncrementedThe configuration’s versioning is updated correctly by setting the sequence number to 82. This minor but important change ensures that clients recognize the new configuration version and load updated messages accordingly.
297-388
: New Solana Staking Action AddedA new action has been introduced to support Solana staking. In this block the following key aspects are addressed:
- The conditions include a
"settings"
check with{ "sol": true }
together with an environment constraint ("desktop": "<24.12.1", "mobile": "!", "web": "!"
).- The
"devices"
array now specifies four device models (T2B1, T3B1, T2T1, and T3T1) with firmware requirement<2.8.9
.- The message content clearly instructs users to update their firmware for the best staking experience and the CTA links to the firmware-index.
- The new property
"context": { "domain": "accounts.sol.staking" }
is included to properly integrate this action with the broader Solana staking support.This implementation aligns well with the PR’s objectives. Please verify that the device conditions are fully aligned with the intended support criteria for Solana staking.
packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx
Show resolved
Hide resolved
33686c6
to
bce4730
Compare
bce4730
to
5c09e22
Compare
Thanks a lot @marekrjpolak ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
suite-common/message-system/config/config.v1.json (1)
1386-1390
: Category Field Consistency Check
While most banner actions now use the array format (e.g."category": ["banner"]
and"category": ["context"]
), note that the action on lines 1386–1390 declares"category": "feature"
. For consistency across the message system configuration, you might want to consider updating this to an array format (e.g."category": ["feature"]
), unless the schema intentionally permits a single string for non-banner messages.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx
(2 hunks)packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx
(2 hunks)suite-common/message-system/config/config.v1.json
(3 hunks)suite-common/message-system/src/messageSystemTypes.ts
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- suite-common/message-system/src/messageSystemTypes.ts
- packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx
- packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: build-web
- GitHub Check: Setup and Cache Dependencies
- GitHub Check: Analyze with CodeQL (javascript)
- GitHub Check: EAS Update
- GitHub Check: prepare_android_test_app
🔇 Additional comments (4)
suite-common/message-system/config/config.v1.json (4)
4-4
: Sequence Number Update
The configuration’s sequence has been incremented from 81 to 82, which signals a new version of the configuration. This minor update is correct and ensures that downstream systems detect the changes.
297-388
: New Solana Staking Action Added
A new action has been introduced for Solana staking. The conditions correctly trigger on settings with"sol": true
and require the desktop and web environments to be above version 25.2.1. The added devices array correctly enforces a firmware condition ("firmware": "<2.8.9"
) for models T2B1, T3B1, T2T1, and T3T1. The message content is well localized with clear CTAs and includes a new context ("domain": "accounts.sol.staking"
), which ties into the updated message system types. Please verify from the UI perspective that the internal link"firmware-index"
is appropriately handled in the component logic.
353-365
: Localization Consistency in Solana Staking Message
The content for the new Solana staking action is properly localized across languages. The messages consistently instruct users to update their Trezor firmware for the best staking experience. Double-check the copy in each language for trademark or technical accuracy, but overall this implementation is clean.
367-384
: Consistent and Clear Call-to-Action Setup
The CTA in the new Solana staking banner uses an internal link to"firmware-index"
with well-translated labels (e.g., “Update now”) across locales. This is consistent with our approach in other actions. If the UI leveragesuseMemo
for action configuration as described in the PR objectives, please ensure that these values are correctly memoized.
This pull request includes several updates to support Solana staking and improve the context message system. The most important changes include adding support for Solana staking in the wallet layout, enhancing the context message component, updating the message system configuration, and modifying the message system types.
Support for Solana staking:
packages/suite/src/components/wallet/WalletLayout/AccountBanners/AccountBanners.tsx
: AddedisSupportedSolStakingNetworkSymbol
check to display Solana staking context messages. [1] [2]Enhancements to context message component:
packages/suite/src/components/wallet/WalletLayout/AccountBanners/ContextMessage.tsx
: IntroduceduseMemo
for action configuration, added dispatch for internal and external links, and included Tor URL handling. [1] [2]Updates to message system configuration:
suite-common/message-system/config/config.v1.json
: Added new message for Solana staking and updated the sequence number. [1] [2] [3]Modifications to message system types:
suite-common/message-system/src/messageSystemTypes.ts
: AddedsolStaking
to theContext
object.Screenshots:
Zaznam.obrazovky.2025-02-28.v.10.47.47.mov